home *** CD-ROM | disk | FTP | other *** search
/ Digitalfoto 118 / Digitalfoto 118.iso / mac / programas / 00 / start.swf / scripts / frame_1 / DoAction.as < prev   
Text File  |  2009-11-16  |  18KB  |  621 lines

  1. if(_global.$tweenManager == undefined)
  2. {
  3.    _global.$tweenManager = new zigo.tweenManager();
  4. }
  5. else
  6. {
  7.    _global.$tweenManager.cleanUp();
  8.    _global.$tweenManager.init();
  9. }
  10. com.robertpenner.easing.Back;
  11. com.robertpenner.easing.Bounce;
  12. com.robertpenner.easing.Circ;
  13. com.robertpenner.easing.Cubic;
  14. com.robertpenner.easing.Elastic;
  15. com.robertpenner.easing.Expo;
  16. com.robertpenner.easing.Linear;
  17. com.robertpenner.easing.Quad;
  18. com.robertpenner.easing.Quart;
  19. com.robertpenner.easing.Quint;
  20. com.robertpenner.easing.Sine;
  21. var Mp = MovieClip.prototype;
  22. Mp.addListener = function()
  23. {
  24.    if(!this._listeners)
  25.    {
  26.       AsBroadcaster.initialize(this);
  27.    }
  28.    this.addListener.apply(this,arguments);
  29. };
  30. ASSetPropFlags(Mp,"addListener",1,0);
  31. Mp.tween = function(props, pEnd, seconds, animType, delay, callback, extra1, extra2)
  32. {
  33.    if(_global.$tweenManager.isTweenLocked(this))
  34.    {
  35.       return undefined;
  36.    }
  37.    if(arguments.length < 2)
  38.    {
  39.       return undefined;
  40.    }
  41.    if(typeof props == "string")
  42.    {
  43.       if(props.indexOf(",") > -1)
  44.       {
  45.          props = props.split(" ").join("").split(",");
  46.       }
  47.       else
  48.       {
  49.          props = [props];
  50.       }
  51.    }
  52.    if(!(pEnd instanceof Array))
  53.    {
  54.       pEnd = [pEnd];
  55.       while(pEnd.length < props.length)
  56.       {
  57.          pEnd.push(pEnd[0]);
  58.       }
  59.    }
  60.    if(seconds == undefined)
  61.    {
  62.       seconds = 2;
  63.    }
  64.    else if(seconds < 0.01)
  65.    {
  66.       seconds = 0;
  67.    }
  68.    if(delay < 0.01 || delay == undefined)
  69.    {
  70.       delay = 0;
  71.    }
  72.    switch(typeof animType)
  73.    {
  74.       case "string":
  75.          animType = animType.toLowerCase();
  76.          if(animType == "linear")
  77.          {
  78.             var eqf = com.robertpenner.easing.Linear.easeNone;
  79.          }
  80.          else if(animType.indexOf("easeoutin") == 0)
  81.          {
  82.             var t = animType.substr(9);
  83.             t = t.charAt(0).toUpperCase() + t.substr(1);
  84.             var eqf = com.robertpenner.easing[t].easeOutIn;
  85.          }
  86.          else if(animType.indexOf("easeinout") == 0)
  87.          {
  88.             var t = animType.substr(9);
  89.             t = t.charAt(0).toUpperCase() + t.substr(1);
  90.             var eqf = com.robertpenner.easing[t].easeInOut;
  91.          }
  92.          else if(animType.indexOf("easein") == 0)
  93.          {
  94.             var t = animType.substr(6);
  95.             t = t.charAt(0).toUpperCase() + t.substr(1);
  96.             var eqf = com.robertpenner.easing[t].easeIn;
  97.          }
  98.          else if(animType.indexOf("easeout") == 0)
  99.          {
  100.             var t = animType.substr(7);
  101.             t = t.charAt(0).toUpperCase() + t.substr(1);
  102.             var eqf = com.robertpenner.easing[t].easeOut;
  103.          }
  104.          if(eqf == undefined)
  105.          {
  106.             var eqf = com.robertpenner.easing.Expo.easeOut;
  107.          }
  108.          break;
  109.       case "function":
  110.          var eqf = animType;
  111.          break;
  112.       case "object":
  113.          if(animType.ease != undefined && animType.pts != undefined)
  114.          {
  115.             var eqf = animType.ease;
  116.             extra1 = animType.pts;
  117.          }
  118.          else
  119.          {
  120.             var eqf = com.robertpenner.easing.Expo.easeOut;
  121.          }
  122.          break;
  123.       default:
  124.          var eqf = com.robertpenner.easing.Expo.easeOut;
  125.    }
  126.    switch(typeof callback)
  127.    {
  128.       case "function":
  129.          callback = {func:callback,scope:this._parent};
  130.          break;
  131.       case "string":
  132.          var ilp;
  133.          var funcp;
  134.          var scope;
  135.          var args;
  136.          var a;
  137.          ilp = callback.indexOf("(");
  138.          funcp = callback.slice(0,ilp);
  139.          scope = eval(funcp.slice(0,funcp.lastIndexOf(".")));
  140.          func = eval(funcp);
  141.          args = callback.slice(ilp + 1,callback.lastIndexOf(")")).split(",");
  142.          var i = 0;
  143.          while(i < args.length)
  144.          {
  145.             a = eval(args[i]);
  146.             if(a != undefined)
  147.             {
  148.                args[i] = a;
  149.             }
  150.             i++;
  151.          }
  152.          callback = {func:func,scope:scope,args:args};
  153.    }
  154.    if(_global.$tweenManager.autoStop)
  155.    {
  156.       _global.$tweenManager.removeTween(this);
  157.    }
  158.    if(delay > 0)
  159.    {
  160.       _global.$tweenManager.addTweenWithDelay(delay,this,props,pEnd,seconds,eqf,callback,extra1,extra2);
  161.    }
  162.    else
  163.    {
  164.       _global.$tweenManager.addTween(this,props,pEnd,seconds,eqf,callback,extra1,extra2);
  165.    }
  166. };
  167. Mp.stopTween = function(props)
  168. {
  169.    if(typeof props == "string")
  170.    {
  171.       if(props.indexOf(",") > -1)
  172.       {
  173.          props = props.split(" ").join("").split(",");
  174.       }
  175.       else
  176.       {
  177.          props = [props];
  178.       }
  179.    }
  180.    _global.$tweenManager.removeTween(this,props);
  181. };
  182. Mp.isTweening = function(prop)
  183. {
  184.    return _global.$tweenManager.isTweening(this,prop);
  185. };
  186. Mp.getTweens = function()
  187. {
  188.    return _global.$tweenManager.getTweens(this);
  189. };
  190. Mp.lockTween = function()
  191. {
  192.    _global.$tweenManager.lockTween(this,true);
  193. };
  194. Mp.unlockTween = function()
  195. {
  196.    _global.$tweenManager.lockTween(this,false);
  197. };
  198. Mp.isTweenLocked = function()
  199. {
  200.    return _global.$tweenManager.isTweenLocked(this);
  201. };
  202. Mp.isTweenPaused = function(prop)
  203. {
  204.    return _global.$tweenManager.isTweenPaused(this,prop);
  205. };
  206. Mp.pauseTween = function(props)
  207. {
  208.    var _loc4_ = undefined;
  209.    if(props != undefined)
  210.    {
  211.       if(typeof props == "string")
  212.       {
  213.          if(props.indexOf(",") > -1)
  214.          {
  215.             props = props.split(" ").join("").split(",");
  216.          }
  217.          else
  218.          {
  219.             props = [props];
  220.          }
  221.       }
  222.       _loc4_ = {};
  223.       for(var _loc5_ in props)
  224.       {
  225.          _loc4_[props[_loc5_]] = true;
  226.       }
  227.    }
  228.    _global.$tweenManager.pauseTween(this,_loc4_);
  229. };
  230. Mp.unpauseTween = function(props)
  231. {
  232.    var _loc4_ = undefined;
  233.    if(props != undefined)
  234.    {
  235.       if(typeof props == "string")
  236.       {
  237.          if(props.indexOf(",") > -1)
  238.          {
  239.             props = props.split(" ").join("").split(",");
  240.          }
  241.          else
  242.          {
  243.             props = [props];
  244.          }
  245.       }
  246.       _loc4_ = {};
  247.       for(var _loc5_ in props)
  248.       {
  249.          _loc4_[props[_loc5_]] = true;
  250.       }
  251.    }
  252.    _global.$tweenManager.unpauseTween(this,_loc4_);
  253. };
  254. Mp.pauseAllTweens = function()
  255. {
  256.    _global.$tweenManager.pauseTween();
  257. };
  258. Mp.unpauseAllTweens = function()
  259. {
  260.    _global.$tweenManager.unpauseTween();
  261. };
  262. Mp.stopAllTweens = function()
  263. {
  264.    _global.$tweenManager.stopAll();
  265. };
  266. Mp.ffTween = function(props)
  267. {
  268.    var _loc4_ = undefined;
  269.    if(props != undefined)
  270.    {
  271.       if(typeof props == "string")
  272.       {
  273.          if(props.indexOf(",") > -1)
  274.          {
  275.             props = props.split(" ").join("").split(",");
  276.          }
  277.          else
  278.          {
  279.             props = [props];
  280.          }
  281.       }
  282.       _loc4_ = {};
  283.       for(var _loc5_ in props)
  284.       {
  285.          _loc4_[props[_loc5_]] = true;
  286.       }
  287.    }
  288.    _global.$tweenManager.ffTween(this,_loc4_);
  289. };
  290. Mp.rewTween = function(props)
  291. {
  292.    var _loc4_ = undefined;
  293.    if(props != undefined)
  294.    {
  295.       if(typeof props == "string")
  296.       {
  297.          if(props.indexOf(",") > -1)
  298.          {
  299.             props = props.split(" ").join("").split(",");
  300.          }
  301.          else
  302.          {
  303.             props = [props];
  304.          }
  305.       }
  306.       _loc4_ = {};
  307.       for(var _loc5_ in props)
  308.       {
  309.          _loc4_[props[_loc5_]] = true;
  310.       }
  311.    }
  312.    _global.$tweenManager.rewTween(this,_loc4_);
  313. };
  314. Mp.alphaTo = function(destAlpha, seconds, animType, delay, callback, extra1, extra2)
  315. {
  316.    this.tween(["_alpha"],[destAlpha],seconds,animType,delay,callback,extra1,extra2);
  317. };
  318. Mp.scaleTo = function(destScale, seconds, animType, delay, callback, extra1, extra2)
  319. {
  320.    this.tween(["_xscale","_yscale"],[destScale,destScale],seconds,animType,delay,callback,extra1,extra2);
  321. };
  322. Mp.sizeTo = function(destSize, seconds, animType, delay, callback, extra1, extra2)
  323. {
  324.    this.tween(["_width","_height"],[destSize,destSize],seconds,animType,delay,callback,extra1,extra2);
  325. };
  326. Mp.slideTo = function(destX, destY, seconds, animType, delay, callback, extra1, extra2)
  327. {
  328.    this.tween(["_x","_y"],[destX,destY],seconds,animType,delay,callback,extra1,extra2);
  329. };
  330. Mp.rotateTo = function(destRotation, seconds, animType, delay, callback, extra1, extra2)
  331. {
  332.    this.tween(["_rotation"],[destRotation],seconds,animType,delay,callback,extra1,extra2);
  333. };
  334. _global.getColorTransObj = function(type, amt, rgb)
  335. {
  336.    switch(type)
  337.    {
  338.       case "brightness":
  339.          var _loc4_ = 100 - Math.abs(amt);
  340.          var _loc6_ = 0;
  341.          if(amt > 0)
  342.          {
  343.             _loc6_ = 256 * (amt / 100);
  344.          }
  345.          return {ra:_loc4_,rb:_loc6_,ga:_loc4_,gb:_loc6_,ba:_loc4_,bb:_loc6_};
  346.       case "brightOffset":
  347.          _loc6_ = 256 * (amt / 100);
  348.          return {ra:100,rb:_loc6_,ga:100,gb:_loc6_,ba:100,bb:_loc6_};
  349.       case "contrast":
  350.          var _loc2_ = {};
  351.          _loc2_.ba = _loc0_ = amt;
  352.          _loc2_.ga = _loc0_;
  353.          _loc2_.ra = _loc0_;
  354.          _loc2_.bb = _loc0_ = 128 - 1.28 * amt;
  355.          _loc2_.gb = _loc0_;
  356.          _loc2_.rb = _loc0_;
  357.          return _loc2_;
  358.       case "invertColor":
  359.          _loc2_ = {};
  360.          _loc2_.ba = _loc0_ = 100 - 2 * amt;
  361.          _loc2_.ga = _loc0_;
  362.          _loc2_.ra = _loc0_;
  363.          _loc2_.bb = _loc0_ = amt * 2.55;
  364.          _loc2_.gb = _loc0_;
  365.          _loc2_.rb = _loc0_;
  366.          return _loc2_;
  367.       case "tint":
  368.          if(rgb == undefined || rgb == null)
  369.          {
  370.             break;
  371.          }
  372.          var _loc8_ = rgb >> 16;
  373.          var _loc9_ = rgb >> 8 & 255;
  374.          var _loc7_ = rgb & 255;
  375.          var _loc5_ = amt / 100;
  376.          _loc2_ = {rb:_loc8_ * _loc5_,gb:_loc9_ * _loc5_,bb:_loc7_ * _loc5_};
  377.          _loc2_.ba = _loc0_ = 100 - amt;
  378.          _loc2_.ga = _loc0_;
  379.          _loc2_.ra = _loc0_;
  380.          return _loc2_;
  381.    }
  382.    return {rb:0,ra:100,gb:0,ga:100,bb:0,ba:100};
  383. };
  384. Mp.brightnessTo = function(bright, seconds, animType, delay, callback, extra1, extra2)
  385. {
  386.    this.tween(["_ct_"],[getColorTransObj("brightness",bright)],seconds,animType,delay,callback,extra1,extra2);
  387. };
  388. Mp.brightOffsetTo = function(percent, seconds, animType, delay, callback, extra1, extra2)
  389. {
  390.    this.tween(["_ct_"],[getColorTransObj("brightOffset",percent)],seconds,animType,delay,callback,extra1,extra2);
  391. };
  392. Mp.contrastTo = function(percent, seconds, animType, delay, callback, extra1, extra2)
  393. {
  394.    this.tween(["_ct_"],[getColorTransObj("contrast",percent)],seconds,animType,delay,callback,extra1,extra2);
  395. };
  396. Mp.colorTo = function(rgb, seconds, animType, delay, callback, extra1, extra2)
  397. {
  398.    this.tween(["_ct_"],[getColorTransObj("tint",100,rgb)],seconds,animType,delay,callback,extra1,extra2);
  399. };
  400. Mp.colorTransformTo = function(ra, rb, ga, gb, ba, bb, aa, ab, seconds, animType, delay, callback, extra1, extra2)
  401. {
  402.    var _loc2_ = {ra:ra,rb:rb,ga:ga,gb:gb,ba:ba,bb:bb,aa:aa,ab:ab};
  403.    this.tween(["_ct_"],[_loc2_],seconds,animType,delay,callback,extra1,extra2);
  404. };
  405. Mp.invertColorTo = function(percent, seconds, animType, delay, callback, extra1, extra2)
  406. {
  407.    this.tween(["_ct_"],[getColorTransObj("invertColor",percent)],seconds,animType,delay,callback,extra1,extra2);
  408. };
  409. Mp.tintTo = function(rgb, percent, seconds, animType, delay, callback, extra1, extra2)
  410. {
  411.    this.tween(["_ct_"],[getColorTransObj("tint",percent,rgb)],seconds,animType,delay,callback,extra1,extra2);
  412. };
  413. Mp.getFrame = function()
  414. {
  415.    return this._currentframe;
  416. };
  417. Mp.setFrame = function(fr)
  418. {
  419.    this.gotoAndStop(Math.round(fr));
  420. };
  421. Mp.addProperty("_frame",Mp.getFrame,Mp.setFrame);
  422. Mp.frameTo = function(endframe, duration, animType, delay, callback, extra1, extra2)
  423. {
  424.    if(endframe == undefined)
  425.    {
  426.       endframe = this._totalframes;
  427.    }
  428.    this.tween("_frame",endframe,duration,animType,delay,callback,extra1,extra2);
  429. };
  430. var TFP = TextField.prototype;
  431. if(!TFP.origAddListener)
  432. {
  433.    TFP.origAddListener = TFP.addListener;
  434.    ASSetPropFlags(TFP,"origAddListener",1,0);
  435.    TFP.addListener = function()
  436.    {
  437.       if(!this._listeners)
  438.       {
  439.          AsBroadcaster.initialize(this);
  440.       }
  441.       this.origAddListener.apply(this,arguments);
  442.    };
  443. }
  444. var $_$methods = ["tween","stopTween","isTweening","getTweens","lockTween","isTweenLocked","unlockTween","isTweenPaused","pauseTween","unpauseTween","pauseAllTweens","unpauseAllTweens","stopAllTweens","ffTween","rewTween","getFrame","setFrame","_frame","frameTo","alphaTo","brightnessTo","colorTo","colorTransformTo","invertColorTo","tintTo","scaleTo","sizeTo","slideTo","rotateTo","brightOffsetTo","contrastTo"];
  445. for(var $_$i in $_$methods)
  446. {
  447.    ASSetPropFlags(Mp,$_$methods[$_$i],1,0);
  448.    if($_$methods[$_$i].toLowerCase().indexOf("frame") == -1)
  449.    {
  450.       TFP[$_$methods[$_$i]] = Mp[$_$methods[$_$i]];
  451.       ASSetPropFlags(TFP,$_$methods[$_$i],1,0);
  452.    }
  453. }
  454. delete Mp;
  455. delete TFP;
  456. delete $_$methods;
  457. delete $_$i;
  458. TextField.prototype.typeWriter = function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
  459. {
  460.    clearInterval(this.tw__interval);
  461.    var originalTxt = arg1;
  462.    this._visible = false;
  463.    if(this.html)
  464.    {
  465.       this.htmlText = arg1;
  466.    }
  467.    else
  468.    {
  469.       this.text = arg1;
  470.    }
  471.    if(arg4 == undefined || null)
  472.    {
  473.       arg4 = "";
  474.    }
  475.    var txt = this.text;
  476.    var txt_length = txt.length;
  477.    this.text = "";
  478.    if(this.autoSize == false || "none")
  479.    {
  480.       var last_visible_word = 0;
  481.       var last_visible_character = 0;
  482.       var txt_array = txt.split(" ");
  483.       var temp_string = "";
  484.       var i = 0;
  485.       while(i < txt_array.length)
  486.       {
  487.          temp_string += txt_array[i] + " ";
  488.          this.text = temp_string;
  489.          if(this.textHeight > this._height)
  490.          {
  491.             last_visible_character = temp_string.length;
  492.             last_visible_word = i - 1;
  493.             break;
  494.          }
  495.          i++;
  496.       }
  497.       if(last_visible_word == 0)
  498.       {
  499.          last_visible_character = txt_length;
  500.       }
  501.    }
  502.    else
  503.    {
  504.       last_visible_character = txt_length;
  505.    }
  506.    this.text = "";
  507.    this._visible = true;
  508.    txt_array = [];
  509.    var w = 0;
  510.    var dw = Math.acos((last_visible_character - 0.2) / last_visible_character);
  511.    var characters_counter = 0;
  512.    var characters = 0;
  513.    var characters_basis = last_visible_character;
  514.    var characters_div = 0;
  515.    if(last_visible_character > arg3)
  516.    {
  517.       var characters = Math.round(last_visible_character * Math.sin(dw));
  518.       while(characters_counter < last_visible_character - arg3)
  519.       {
  520.          txt_array.push(txt.substring(characters_counter,characters_counter + characters));
  521.          characters_counter += characters;
  522.       }
  523.       characters_basis = last_visible_character - characters_counter;
  524.       characters_div = characters_counter;
  525.       dw = Math.acos((characters_basis - 0.2) / characters_basis);
  526.    }
  527.    var w = dw;
  528.    while(w <= 1.5707963267948966)
  529.    {
  530.       characters = Math.round(characters_div + characters_basis * Math.sin(w));
  531.       if(characters <= characters_counter)
  532.       {
  533.          characters = characters_counter + 1;
  534.       }
  535.       if(characters >= last_visible_character)
  536.       {
  537.          characters = last_visible_character;
  538.          txt_array.push(txt.substring(characters_counter,characters));
  539.          break;
  540.       }
  541.       txt_array.push(txt.substring(characters_counter,characters));
  542.       characters_counter = characters;
  543.       w += dw;
  544.    }
  545.    temp_string = "";
  546.    var txtPfad = this;
  547.    var tw__interval = this.tw__interval = setInterval(function()
  548.    {
  549.       if(eval(txtPfad) == undefined)
  550.       {
  551.          clearInterval(tw__interval);
  552.       }
  553.       if(txt_array.length > 0)
  554.       {
  555.          temp_string += txt_array.shift();
  556.          txtPfad.text = temp_string + arg4;
  557.       }
  558.       else
  559.       {
  560.          clearInterval(tw__interval);
  561.          if(txtPfad.html)
  562.          {
  563.             txtPfad.htmlText = originalTxt;
  564.          }
  565.          else
  566.          {
  567.             txtPfad.text = originalTxt;
  568.          }
  569.          if(arg5)
  570.          {
  571.             txtPfad.styleSheet = arg5;
  572.          }
  573.          if(arg6)
  574.          {
  575.             arg6.apply(null,arg7);
  576.          }
  577.       }
  578.    }
  579.    ,arg2);
  580. };
  581. ASSetPropFlags(TextField.prototype,"typeWriter",1,0);
  582. TextField.prototype.stringCutter_advanced = function(arg1, arg2)
  583. {
  584.    var _loc8_ = this.textHeight;
  585.    if(arg1 == undefined)
  586.    {
  587.       arg1 = " ";
  588.    }
  589.    var _loc4_ = 0;
  590.    this.scroll = 1;
  591.    while(this.maxscroll > 1)
  592.    {
  593.       var _loc2_ = 0;
  594.       while(this.scroll <= 1 && _loc2_ < this.text.length)
  595.       {
  596.          _loc2_ = _loc2_ + 1;
  597.          Selection.setFocus(this);
  598.          this.scroll = 1;
  599.          Selection.setSelection(0,_loc2_);
  600.       }
  601.       var _loc5_ = this.text.lastIndexOf("\r",_loc2_ - _loc4_);
  602.       var _loc6_ = this.text.lastIndexOf(" ",_loc2_ - _loc4_);
  603.       var _loc3_ = Math.max(_loc5_,_loc6_);
  604.       if(_loc3_ == -1)
  605.       {
  606.          _loc3_ = _loc2_ - _loc4_ - arg1.length - 1;
  607.          break;
  608.       }
  609.       Selection.setFocus(this);
  610.       Selection.setSelection(_loc3_,this.length);
  611.       this.replaceSel(arg1);
  612.       this.scroll = 1;
  613.       _loc4_ += 2;
  614.    }
  615.    if(arg2)
  616.    {
  617.       this.styleSheet = arg2;
  618.    }
  619. };
  620. ASSetPropFlags(TextField.prototype,"stringCutter_advanced",1,0);
  621.